klotz: python 3.10* + contextmanager*

0 bookmark(s) - Sort by: Date ↓ / Title / - Bookmarks from other users for this tag

  1. # After Python 3.10 Release
    from contextlib import contextmanager

    @contextmanager
    def f(x):
    try:
    yield x
    finally:
    pass
    # Example 1
    with f('c') as a,
    f('a') as b:
    pass
    # Example 2
    with f('c') as a,
    f('a') as b,
    f('a') as c:
    pass
    2021-12-14 Tags: , , , by klotz

Top of the page

First / Previous / Next / Last / Page 1 of 0 SemanticScuttle - klotz.me: Tags: python 3.10 + contextmanager

About - Propulsed by SemanticScuttle